<?

$name = 'Categories';

$thead = array('Category','Time (Minutes)');
$tsize = array('70%', '30%');
$talign = array('left', 'center');
$twidth = '500';

$rlabel = 0;
$rdata = 1;

$sql = 'SELECT c.name, SUM(seconds) / 60 as stotal FROM wp_track w, category c, task t WHERE w.idt = t.id AND t.idc = c.id GROUP BY c.id ORDER BY stotal DESC';


//$sql = 'SELECT c.name, t.name, SUM(seconds) as stotal FROM wp_track w, category c, task t WHERE w.idt = t.id AND t.idc = c.id GROUP BY t.id ORDER BY stotal DESC';

//$sql = 'SELECT p.name, SUM(seconds) as stotal FROM wp_track w, processes p WHERE p.id = w.idp GROUP BY p.id ORDER BY stotal DESC';

//$sql = 'SELECT w.title, SUM(seconds) as stotal FROM wp_track wp, windows w WHERE w.id = wp.idw GROUP BY w.id ORDER BY stotal DESC';


?>